<jsp:include page="logincheck.jsp" />
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.lang.Number" %>

<jsp:useBean id="phone" class="se2.PhoneAccount" scope="request"/>
<jsp:setProperty name="phone" property="*"/>

	<% 
		phone.setId(Integer.parseInt(request.getParameter("id")));
		phone.getPhoneAccountFromDatabase();
		
		DecimalFormat dcf = new DecimalFormat ("#0.00");
		String dolamt = request.getParameter("amount");
		double amt = (dcf.parse(dolamt)).doubleValue();
		
		phone.setBalance(phone.getBalance() - amt);
		phone.updateBalance();
	%>
	
	<jsp:forward page="viewBill.jsp">
	<jsp:param name="id" value="<%= request.getParameter("id") %>" />
	<jsp:param name="cid" value="<%= request.getParameter("cid") %>" />
	</jsp:forward>